package org.lovebugs.adapter;

import java.util.List;

import org.lovebugs.dkm.R;
import org.lovebugs.pojo.KmItem;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

public class SMSListAdapter extends BaseAdapter {

private List<KmItem> mDataItems;
	
	private Context mContext;
	
	public SMSListAdapter(Context context,List<KmItem> datas) {
		this.mDataItems = datas;
		mContext = context;
	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return mDataItems.size();
	}

	@Override
	public Object getItem(int position) {
		// TODO Auto-generated method stub
		return mDataItems.get(position);
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		// TODO Auto-generated method stub
		View itemView;
		if(convertView==null) {
			itemView = View.inflate(mContext, R.layout.sms_item, null);
		}else{
			itemView = convertView;
		}
		return itemView;
	}

}
